package cn.jingyuan.owl.dao.core;

import java.util.List;

/**
 * 分片数据存取接口
 *
 * @param <E> 实体
 * @param <ID> 主键
 * @param <SK> 分片键
 */
public interface CrudShardingDao<E, ID, SK> extends EmptyDao<E, ID> {

    int insert(SK sk, E entity);

    int inserts(SK sk, List<E> entities);

    int insertSelective(SK sk, E entity);

    int insertsSelective(SK sk, List<E> entities);

    int deleteById(SK sk, ID id);

    int deleteByIds(SK sk, List<ID> ids);

    int deletesAll();

    int updateById(SK sk, E entity);

    int updateByIds(SK sk, List<E> entities);

    int updateByIdSelective(SK sk, E entity);

    int updateByIdsSelective(SK sk, List<E> entities);

    E getById(SK sk, ID id);

    List<E> getByIds(SK sk, List<ID> ids);

    List<E> getAll(SK sk);

    int count(SK sk);

    int countByIds(SK sk, List<ID> ids);

}
